<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
    <div id="top" style="width: 100px;height: 100px;background: rosybrown;" onclick="toClick('top')">
        <div id="bottom" style="width: 50px;height: 50px;background: #9ab3f5;" onclick="toClick('bottom')"></div>
    </div>
</body>
<script>
    window.toClick = function(tar) {
        console.log(`====== click ======`)
        console.log(`this = ${tar}`);
        let t = window.event;
        console.log(t.target.id);
        console.log(t.currentTarget.id);
    }
</script>
</html>
